package org.youyun56.gpsserver.command;

import org.youyun56.gpsserver.CacheFactory;
import org.youyun56.gpsserver.Task;
import org.youyun56.gpsserver.common.GoodSearch;
import org.youyun56.gpsserver.common.YouyunMap;

public class GoodSearchExecutor extends Task {

    @Override
    public Object execute() throws Exception {
        YouyunMap map = command.getParameters();
        GoodSearch goodSearch = new GoodSearch();
        goodSearch.setFromCity(map.getInt("fromCity"));
        goodSearch.setTargetCity(map.getInt("targetCity"));
        goodSearch.setToCity(map.getInt("toCity"));
        goodSearch.setGsCarType(map.get("gsCarType"));
        goodSearch.setGsEndMi(map.getFloat("gsEndMi"));
        goodSearch.setGsFromMi(map.getFloat("gsFromMi"));
        goodSearch.setGsHearvyType(map.get("gsHearvyType"));
        goodSearch.setGsHearvyUnin(map.get("gsHearvyUnin"));
        goodSearch.setHearvyEnd(map.getFloat("hearvyEnd"));
        goodSearch.setHearvyFrom(map.getFloat("hearvyFrom"));
        return CacheFactory.instance.goodSearch(goodSearch);
    }

}
